package top.yuyufeng.learn.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import top.yuyufeng.learn.mapper.UserInfoMapper;
import top.yuyufeng.learn.modal.UserInfo;

import java.util.List;

/**
 * @author yuyufeng
 * @date 2018/5/17.
 */
@Repository
public class UserInfoDao {
    @Autowired
    private UserInfoMapper userInfoMapper;

    public void getPage(){
        List<UserInfo> userInfoList = userInfoMapper.selectAll();
        for (UserInfo userInfo : userInfoList) {
            System.out.println(userInfo);
        }
    }

    public void insertBatch(List<UserInfo> list) {
        userInfoMapper.insertBatch(list);
    }

    public List<UserInfo> selectAll() {
        return userInfoMapper.selectAll();
    }

    public List<UserInfo> select(UserInfo record) {
       return userInfoMapper.select(record);
    }

    public int insert(UserInfo record) {
        return userInfoMapper.insert(record);
    }
}
